package com.ruoyi.attachment.mapper;




import com.ruoyi.attachment.domain.Attachment;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 附件Mapper接口
 *
 * @author ruoyi
 * @date 2022-05-18
 */
public interface AttachmentMapper
{
    /**
     * 查询附件
     *
     * @param attachmentId 附件主键
     * @return 附件
     */
    public Attachment selectAttachmentByAttachmentId(Long attachmentId);

    /**
     * 查询附件列表
     *
     * @param attachment 附件
     * @return 附件集合
     */
    public List<Attachment> selectAttachmentList(Attachment attachment);

    /**
     * 新增附件
     *
     * @param attachment 附件
     * @return 结果
     */
    public int insertAttachment(Attachment attachment);

    /**
     * 修改附件
     *
     * @param attachment 附件
     * @return 结果
     */
    public int updateAttachment(Attachment attachment);

    /**
     * 删除附件
     *
     * @param attachmentId 附件主键
     * @return 结果
     */
    public int deleteAttachmentByAttachmentId(Long attachmentId);

    /**
     * 批量删除附件
     *
     * @param attachmentIds 需要删除的数据主键集合
     * @return 结果
     */
    public int deleteAttachmentByAttachmentIds(Long[] attachmentIds);

    /**
     * 根据id查询
     * @param id
     * @return
     */
    List<Attachment> selectAttachmentListById(@Param(value = "id") Long id, @Param(value = "tableName") String tableName);

    void deleteAttachmentByAttachmentName(@Param("attachmentName") String attachmentName);
}
